/************************************************************************************
**  
* @copyright (c) 2015-, ChengDu Westone Technology Co., LTD. All Right Reserved.
*
*************************************************************************************/
/**
* @file	    duye_if_dev.h
* @version     
* @brief      
* @author   
* @date     2013-03-31
* @note 
*
*  1. 2018-03-31 created this file
* 
*/
#pragma once

#include <list>
#include <duye_type.h>

namespace duye {

class NetIfDev {
public:
	NetIfDev() {}
	~NetIfDev() {}

	void setName(const std::string& name) { m_name = name; }
	const std::string& getName() const { return m_name; }

	void setIfId(const std::string& ifId) { m_ifId = ifId; }
	const std::string& getIfId() const { return m_ifId; }

	void setDesc(const std::string& desc) { m_desc = desc; }
	const std::string& getDesc() const { return m_desc; }

	void setMac(const std::string& mac) { m_mac = mac; }
	const std::string& getMac() const { return m_mac; }

	void setIP(const std::string& ip) { m_ip = ip; }
	const std::string& getIP() const { return m_ip; }

	void setMask(const std::string& mask) { m_mask = mask; }
	const std::string& getMask() const { return m_mask; }

	void setGateway(const std::string& gateway) { m_gateway = gateway; }
	const std::string& getGateway() const { return m_gateway; }

	void setEnabled(const bool enabled) { m_enabled = enabled; }
	bool getEnabled() const { return m_enabled; }

private:
	std::string m_name;
	std::string m_ifId;
	std::string m_desc;
	std::string m_mac;
	std::string m_ip;
	std::string m_mask;
	std::string m_gateway;
	bool m_enabled;
};

typedef std::list<NetIfDev> NetIfDevList;

class NetIfDevMgr {
public:
	NetIfDevMgr() {}
	~NetIfDevMgr() {}
	bool getInterfaceList(NetIfDevList& netIfDevs);
    bool getInterface(const std::string& ifDesc, NetIfDev& ifDev);
};

}
